package com.greyshark.sanotrive.main

import androidx.lifecycle.LiveData
import com.common.app.data.bean.bleDevice.CloudRingInfoBean
import com.common.app.data.bean.user.UserBean
import com.common.app.data.bean.user.UserGoalBean
import com.common.app.data.repository.BleDeviceApi
import com.common.app.data.repository.UserApi
import com.common.app.viewmodel.CommonViewModel
import com.common.base.app.viewmodel.Cancel
import com.common.base.data.CommonBean
import com.module.aichat.data.AiChatApi

/**
 * 作者：sosou
 * <p>
 * 版本：1.0
 * <p>
 * 创建日期：2022/8/19
 * <p>
 * 描述：
 * <p>
 * 修订历史：
 */
class MainViewModel : CommonViewModel() {

    //获取用户信息
    fun getUserInfo(): LiveData<CommonBean<UserBean>> = emit({}) {
        UserApi.getUserInfo()
    }

    //戒指设备绑定
    fun upBindRing(producer:Int,sn:String,firm:String,macAddr:String, size:Int, color:Int): LiveData<CommonBean<CloudRingInfoBean>> = emit({}) {
        BleDeviceApi.upBindRing(producer,sn,firm,macAddr,size,color)
    }

    //获取用户目标信息
    fun getUserGoalInfo(): LiveData<CommonBean<UserGoalBean>> = emit({}) {
        UserApi.getUserGoalInfo()
    }

    fun requestStopAiMsg(error: Cancel): LiveData<CommonBean<Any>> = emit(error) {
        AiChatApi.requestStopAiMsg()
    }
}